﻿using System.Collections;
using System.Collections.Generic;
using BearUtil.Hidden;
using Sirenix.OdinInspector;
using UnityEngine;
namespace BearUtil
{
	[CreateNodeMenu("自定义节点/角色移动"), Title("角色移动")]
	public class ActorMove : BearNode
	{
		[LabelText("节点类型"), HideInInspector] public int type = 3;

		[LabelText("角色id"), ValueDropdown("getActorName", DropdownWidth = 150), OnValueChanged("setRoleId")]
		public string role_name;
		[HideInInspector]
		public int role_id_move;
		
		private List<string> getActorName()
		{
			return NodeMethodUtil.GetActorName();
		}

		private void setRoleId(string name)
		{
			role_id_move = NodeMethodUtil.FindRoleIDbyName(name);
		}

		[LabelText("终点位置X")]
		public float role_move_pos_x;
		[LabelText("终点位置Y")]
		public float role_move_pos_y;
		[LabelText("镜头是否跟随")]
		public bool camera_follow;
		[LabelText("朝向")]
		public ObjectDirection item_direction;

		public override void Transform()
		{
			base.Transform();
			role_name = NodeMethodUtil.FindRoleNamebyID(role_id_move);
		}
	}
}
